]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ibusManager: Add missing environment variables required to launch ibus-daemon
authorxiaofan <xiaofan@iscas.ac.cn>
Sun, 10 Sep 2023 07:56:33 +0000 (09:56 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 14 Sep 2023 16:02:29 +0000 (16:02 +0000)
IBus requires XAUTHORITY and XDG_RUNTIME_DIR to be able to spawn its XIM
implementation correctly. Using launch context to get environment can correctly
launch on non-systemd setups.

Closes: #6998
Signed-off-by: xiaofan <xiaofan@iscas.ac.cn>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2947>

js/misc/ibusManager.js

index 89889921213a3adee89921d88994c5f887a8f771..510561b4d0defe552ae4dda6818d52f5f9ff2ecd 100644 (file)
@@ -115,17 +115,9 @@ class IBusManager extends Signals.EventEmitter {
 
     _spawn(extraArgs = []) {
         try {
-            let cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
-            let env = [];
-
-            this._tryAppendEnv(env, 'DBUS_SESSION_BUS_ADDRESS');
-            this._tryAppendEnv(env, 'WAYLAND_DISPLAY');
-            this._tryAppendEnv(env, 'HOME');
-            this._tryAppendEnv(env, 'LANG');
-            this._tryAppendEnv(env, 'LC_CTYPE');
-            this._tryAppendEnv(env, 'COMPOSE_FILE');
-            this._tryAppendEnv(env, 'DISPLAY');
-
+            const cmdLine = ['ibus-daemon', '--panel', 'disable', ...extraArgs];
+            const launchContext = global.create_app_launch_context(0, -1);
+            const env = launchContext.get_environment();
             // Use DO_NOT_REAP_CHILD to avoid adouble-fork internally
             // since ibus-daemon refuses to start with init as its parent.
             const [success_, pid] = GLib.spawn_async(